import QtQuick 2.15
import QmlGraphics 1.0

QmlGraphicsItem {
    id: item

    property int rectRadius: 0
    property int borderWidth: 2

    Rectangle {
        id: rect
        anchors.fill: parent
        border.width: 0
        border.color: Qt.rgba(0, 0, 1, 1)
        color: item.background
        antialiasing: true
        radius: rectRadius
    }

    onSelectedChanged: {
       if (item.selected) {
           rect.border.width = borderWidth
       } else {
           rect.border.width = 0
       }
    }
}
